<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

	class Play_durak extends CI_Controller 
	{

		function __construct()
	    {
		    parent::__construct();
		   		$this->load->model('user');
	   	}


		function get_file()
		{
			$id = array();
			$data = array();
			$str = "";

			$data = get_filenames($this->config->item('dir'));

			foreach ($data as $filename) 
			{
				$str = substr($filename, 0, strpos($filename, ".stat"));
				$details = $this->user->get_details($str);
					if($this->session->userdata('user_id') != $str)
					{
						array_push($id, array(
							'username' => $details[0]['username'],
							'fname'    => $details[0]['fname'],
							'lname'    => $details[0]['lname']
							));
					}
			}
		
			echo json_encode($id);
		}

	}

?>